﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace BW.WMS.Application.Features.Supperss.Dtos
{
    /// <summary>
    /// 供应商商品信息
    /// </summary>
    public class SupperProductDto
    {
        /// <summary>
        /// 商品名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; }

        /// <summary>
        /// 单位（如：箱、包等）
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 单价
        /// </summary>
        public decimal UnitPrice { get; set; }

     

        /// <summary>
        /// 商品分类
        /// </summary>
        public string Category { get; set; }

        /// <summary>
        /// 状态：1-在售，0-下架
        /// </summary>
        public byte Status { get; set; } = 1;

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; } = DateTime.Now;




        /// <summary>
        /// 供应商ID（自增主键）
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        public string SName { get; set; }

        /// <summary>
        /// 联系人
        /// </summary>
        public string ContactPerson { get; set; }

        /// <summary>
        /// 联系电话
        /// </summary>
        public string ContactPhone { get; set; }

        /// <summary>
        /// 地址
        /// </summary>
        public string Address { get; set; }

        /// <summary>
        /// 状态：1-正常，0-停用
        /// </summary>
        public byte SStatus { get; set; } = 1;

        
    }

    public class SupperProductQueryDto
    {
        /// <summary>
        ///供应商名字
        /// </summary>
        public string? SName { get; set; }


        /// <summary>
        /// 状态：1-启用，0-停用
        /// </summary>
        public int? Status { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页数量
        /// </summary>
        public int PageSize { get; set; } = 10;

        public int PageCount { get; set; }
    }

    public class ProducstDto
    {

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页数量
        /// </summary>
        public int PageSize { get; set; } = 10;


        /// <summary>
        /// 商品名称
        /// </summary>
        public string? Name { get; set; }


        /// <summary>
        /// 供应商ID（关联供应商表）
        /// </summary>
        public int? SupplierId { get; set; }

    }

    /// <summary>
    /// 供应商商品分配 DTO
    /// </summary>
    public class SupplierProductAssignmentDto
    {
        /// <summary>
        /// 供应商ID
        /// </summary>
        public int SupplierId { get; set; }

        /// <summary>
        /// 商品ID
        /// </summary>
        public int ProductId { get; set; }

        /// <summary>
        /// 供应单价
        /// </summary>
        public decimal SupplyPrice { get; set; }

        /// <summary>
        /// 是否默认供应商（1-是，0-否）
        /// </summary>
        public byte IsDefault { get; set; } = 0;
    }

    /// <summary>
    /// 供应商商品分配查询 DTO
    /// </summary>
    public class SupplierProductQueryDto
    {
        /// <summary>
        /// 供应商ID
        /// </summary>
        public int SupplierId { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页数量
        /// </summary>
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 供应商商品信息 DTO
    /// </summary>
    public class SupplierProductInfoDto
    {
        /// <summary>
        /// 关联记录ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 供应商ID
        /// </summary>
        public int SupplierId { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        public string SupplierName { get; set; }

        /// <summary>
        /// 商品ID
        /// </summary>
        public int ProductId { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string ProductName { get; set; }

        /// <summary>
        /// 商品规格
        /// </summary>
        public string Specification { get; set; }

        /// <summary>
        /// 商品单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 商品状态（1-在售，0-下架）
        /// </summary>
        public byte Status { get; set; }

        /// <summary>
        /// 供应单价
        /// </summary>
        public decimal SupplyPrice { get; set; }

        /// <summary>
        /// 是否默认供应商
        /// </summary>
        public byte IsDefault { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; }
    }

    /// <summary>
    /// 可分配商品信息 DTO
    /// </summary>
    public class AvailableProductDto
    {
        /// <summary>
        /// 商品ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 商品名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; }

        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }

        /// <summary>
        /// 商品分类
        /// </summary>
        public string Category { get; set; }

        /// <summary>
        /// 状态
        /// </summary>
        public byte Status { get; set; }

        /// <summary>
        /// 是否已分配（1-已分配，0-未分配）
        /// </summary>
        public byte IsAssigned { get; set; }
    }

    /// <summary>
    /// 采购单分页查询DTO
    /// </summary>
    public class PurchaseOrderQueryDto
    {
        public int? SupplierId { get; set; }
        public string? OrderNo { get; set; }
        public DateTime? StartDate { get; set; }
        public DateTime? EndDate { get; set; }
        public int PageIndex { get; set; } = 1;
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 供应商下拉框DTO
    /// </summary>
    public class SupplierDropdownDto
    {
        /// <summary>
        /// 供应商ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        public string Name { get; set; }
    }

    /// <summary>
    /// 进货列表查询DTO
    /// </summary>
    public class PurchaseListQueryDto
    {
        /// <summary>
        /// 供应商ID
        /// </summary>
        public int? SupplierId { get; set; }

        /// <summary>
        /// 进货单号
        /// </summary>
        public string? OrderNo { get; set; }

        /// <summary>
        /// 进货人
        /// </summary>
        public string? Purchaser { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        public string? Status { get; set; }

        /// <summary>
        /// 开始日期
        /// </summary>
        public DateTime? StartDate { get; set; }

        /// <summary>
        /// 结束日期
        /// </summary>
        public DateTime? EndDate { get; set; }

        /// <summary>
        /// 当前页码
        /// </summary>
        public int PageIndex { get; set; } = 1;

        /// <summary>
        /// 每页数量
        /// </summary>
        public int PageSize { get; set; } = 10;
    }

    /// <summary>
    /// 进货列表返回DTO
    /// </summary>
    public class PurchaseListDto
    {
        /// <summary>
        /// 进货单ID
        /// </summary>
        public int Id { get; set; }

        /// <summary>
        /// 进货单号
        /// </summary>
        public string OrderNo { get; set; }

        /// <summary>
        /// 进货日期
        /// </summary>
        public DateTime PurchaseDate { get; set; }

        /// <summary>
        /// 供应商ID
        /// </summary>
        public int SupplierId { get; set; }

        /// <summary>
        /// 供应商名称
        /// </summary>
        public string SupplierName { get; set; }

        /// <summary>
        /// 进货人
        /// </summary>
        public string Purchaser { get; set; }

        /// <summary>
        /// 商品信息JSON
        /// </summary>
        public string ProductsInfo { get; set; }

        /// <summary>
        /// 商品数量
        /// </summary>
        public int ProductCount { get; set; }

        /// <summary>
        /// 总金额
        /// </summary>
        public decimal TotalAmount { get; set; }

        /// <summary>
        /// 单据状态
        /// </summary>
        public string Status { get; set; }

        /// <summary>
        /// 备注
        /// </summary>
        public string Remark { get; set; }
    }
}
